//
//  SevenAIModel.swift
//  SevenAISDK
//
//  Created by 七块 on 2025/7/2.
//

import Foundation

/// 日志等级
public enum LogLevel {
    /// 信息
    case INFO
    ///  调试
    case DEBUG
    /// 警告
    case WARN
    /// 错误
    case ERROR
}
/// 初始化参数
public struct InitConfigParams {
    /// appid
    public var appid:String
    /// 日志等级
    public var logLevel:LogLevel
    
    public init(appid: String, logLevel: LogLevel) {
        self.appid = appid
        self.logLevel = logLevel
    }
}
/// SDK回调监听枚举
public enum SevenBlockSDKInitListener {
    /// 初始化成功
    case onInitSuccess
    /// 初始化失败
    case onInitFailed(String,String)
    /// 登录成功
    case onLoginSuccess
    /// 登录失败
    case onLoginFailed(String,String)
    /// 设置SDK信息失败
    case setSDKError(String,String)
}
/// 客户的配置信息
struct CustomConfig {
    /// 货币单位
    var currency:String
    /// 货币图标
    var icon:String
    /// 货币兑换率
    var exchangeRate:Double
}
/// 登录信息
public class LoginInfo:Codable {
    public var appId:String?
    
    public var userId:String?
    
    public var token:String?
}

/// H5控制指令
enum H5Command:String{
    /// 开始工作
    case requestFilePermission      = "requestFilePermission"
    /// 请求录音权限
    case requestAudioPermission     = "requestAudioPermission"
    ///  SDK发起连接设备的请求
    case requestConnectDevice       = "requestConnectDevice"
    /// websocket已连接
    case onWebsocketConnected       = "onWebsocketConnected"
    /// websocket连接失败
    case onWebsocketConnectFailed   = "onWebsocketConnectFailed"
    /// websocket断开
    case onWebsocketDisConnected    = "onWebsocketDisConnected"
    /// 执行控制玩具的操作
    case onToyControlCommand        = "onToyControlCommand"
    /// 支付成功的回调
    case onPaymentSuccess           = "onPaymentSuccess"
    /// 支付失败
    case onPaymentFailed            = "onPaymentFailed"
    /// 支付取消
    case onPaymentCancel            = "onPaymentCancel"
    /// 发起支付
    case requestConsume            = "requestConsume"
    /// 使用客户的支付流程完成充值操作
    case useCustomerPayment            = "useCustomerPayment"
    /// 关闭当前页面
    case closeH5Page            = "closeH5Page"
    ///在进入剧本详情页之前，H5会检查是否存在未支付的聊天消费记录。存在的画面就会提示用户先完成支付之后，才能进入剧本详情页聊天。
    case requestHandleChatConsumeRecords            = "requestHandleChatConsumeRecords"
    /// 在剧本详情、新增剧本、克隆声音、充值页面；
    /// 统一由原生的Webview来处理返回。原因是调起微信充值之后，页面会重新加载导致uni的路由无法返回上一页；
    case goBack = "goBack"
    
}
/// 原生调用JS事件名称
enum JSEventName:String{
  /// 设置jwtToken
    case setToken = "setToken"
  /// 设置设备信息
    case setDeviceInfo = "setDeviceInfo"
  /// 设置设备状态
    case setDeviceStatus = "setDeviceStatus"
  /// 录音权限更新
    case onRecordAudioPermissionUpdate = "onRecordAudioPermissionUpdate"
  /// 文件权限更新
    case onFilePermissionUpdate = "onFilePermissionUpdate"
    /// 支付成功
    case paymentResult = "paymentResult"
    /// 扣款成功
    case deductionResult = "deductionResult"
    /// 通知h5刷新支付结果
    case onQueryRechargeOrderId = "onQueryRechargeOrderId"
}
